package cn.zyb.service.impl;

import cn.zyb.domain.Movie;
import cn.zyb.domain.User;
import cn.zyb.mapper.MovieMapper;
import cn.zyb.service.IMovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.security.krb5.internal.Ticket;

import java.util.List;

@Service
public class MovieServiceImpl implements IMovieService {

    @Autowired
    private MovieMapper movieMapper;

    @Override
    public Movie findOne(Long id) {
        return movieMapper.loadOne(id);
    }

    @Override
    public void addMovieTicket(Long user_id, Long movie_ticket_id) {
        movieMapper.addMovieTicket(user_id, movie_ticket_id);
    }

    @Override
    public List<Ticket> findTicketByUserId(User user) {
        return movieMapper.findTicketByUserId(user);
    }

    @Override
    public void updateTicketByUserId(User user) {
        movieMapper.updateTicketByUserId(user);
    }
}
